package com.newhope.starter.dubbo.properties;

/**
 * Created by sunxiaokun
 */

import org.springframework.boot.context.properties.ConfigurationProperties;

@ConfigurationProperties(
        prefix = "dubbo"
)
public class DubboProperties {
    private String name;
    private String registry = "zookeeper://127.0.0.1:2181";
    private Integer port = Integer.valueOf(-1);
    private Integer timeout = Integer.valueOf(1000);
    private Integer threads = Integer.valueOf(2);
    private Integer heartBeats = Integer.valueOf(30000);
    private String host;
    private String serialization;
    private String version;
    private String mode = "provider";

    public DubboProperties() {
    }

    public String getName() {
        return this.name;
    }

    public String getRegistry() {
        return this.registry;
    }

    public Integer getPort() {
        return this.port;
    }

    public Integer getTimeout() {
        return this.timeout;
    }

    public Integer getThreads() {
        return this.threads;
    }

    public Integer getHeartBeats() {
        return this.heartBeats;
    }

    public String getHost() {
        return this.host;
    }

    public String getSerialization() {
        return this.serialization;
    }

    public String getVersion() {
        return this.version;
    }

    public String getMode() {
        return this.mode;
    }

    public void setName(String name) {
        this.name = name;
    }

    public void setRegistry(String registry) {
        this.registry = registry;
    }

    public void setPort(Integer port) {
        this.port = port;
    }

    public void setTimeout(Integer timeout) {
        this.timeout = timeout;
    }

    public void setThreads(Integer threads) {
        this.threads = threads;
    }

    public void setHeartBeats(Integer heartBeats) {
        this.heartBeats = heartBeats;
    }

    public void setHost(String host) {
        this.host = host;
    }

    public void setSerialization(String serialization) {
        this.serialization = serialization;
    }

    public void setVersion(String version) {
        this.version = version;
    }

    public void setMode(String mode) {
        this.mode = mode;
    }

    public boolean equals(Object o) {
        if(o == this) {
            return true;
        } else if(!(o instanceof DubboProperties)) {
            return false;
        } else {
            DubboProperties other = (DubboProperties)o;
            if(!other.canEqual(this)) {
                return false;
            } else {
                String this$name = this.getName();
                String other$name = other.getName();
                if(this$name == null) {
                    if(other$name != null) {
                        return false;
                    }
                } else if(!this$name.equals(other$name)) {
                    return false;
                }

                String this$registry = this.getRegistry();
                String other$registry = other.getRegistry();
                if(this$registry == null) {
                    if(other$registry != null) {
                        return false;
                    }
                } else if(!this$registry.equals(other$registry)) {
                    return false;
                }

                Integer this$port = this.getPort();
                Integer other$port = other.getPort();
                if(this$port == null) {
                    if(other$port != null) {
                        return false;
                    }
                } else if(!this$port.equals(other$port)) {
                    return false;
                }

                label110: {
                    Integer this$timeout = this.getTimeout();
                    Integer other$timeout = other.getTimeout();
                    if(this$timeout == null) {
                        if(other$timeout == null) {
                            break label110;
                        }
                    } else if(this$timeout.equals(other$timeout)) {
                        break label110;
                    }

                    return false;
                }

                label103: {
                    Integer this$threads = this.getThreads();
                    Integer other$threads = other.getThreads();
                    if(this$threads == null) {
                        if(other$threads == null) {
                            break label103;
                        }
                    } else if(this$threads.equals(other$threads)) {
                        break label103;
                    }

                    return false;
                }

                Integer this$heartBeats = this.getHeartBeats();
                Integer other$heartBeats = other.getHeartBeats();
                if(this$heartBeats == null) {
                    if(other$heartBeats != null) {
                        return false;
                    }
                } else if(!this$heartBeats.equals(other$heartBeats)) {
                    return false;
                }

                label89: {
                    String this$host = this.getHost();
                    String other$host = other.getHost();
                    if(this$host == null) {
                        if(other$host == null) {
                            break label89;
                        }
                    } else if(this$host.equals(other$host)) {
                        break label89;
                    }

                    return false;
                }

                label82: {
                    String this$serialization = this.getSerialization();
                    String other$serialization = other.getSerialization();
                    if(this$serialization == null) {
                        if(other$serialization == null) {
                            break label82;
                        }
                    } else if(this$serialization.equals(other$serialization)) {
                        break label82;
                    }

                    return false;
                }

                String this$version = this.getVersion();
                String other$version = other.getVersion();
                if(this$version == null) {
                    if(other$version != null) {
                        return false;
                    }
                } else if(!this$version.equals(other$version)) {
                    return false;
                }

                String this$mode = this.getMode();
                String other$mode = other.getMode();
                if(this$mode == null) {
                    if(other$mode != null) {
                        return false;
                    }
                } else if(!this$mode.equals(other$mode)) {
                    return false;
                }

                return true;
            }
        }
    }

    public boolean canEqual(Object other) {
        return other instanceof DubboProperties;
    }

    public int hashCode() {
        boolean PRIME = true;
        byte result = 1;
        String $name = this.getName();
        int result1 = result * 31 + ($name == null?0:$name.hashCode());
        String $registry = this.getRegistry();
        result1 = result1 * 31 + ($registry == null?0:$registry.hashCode());
        Integer $port = this.getPort();
        result1 = result1 * 31 + ($port == null?0:$port.hashCode());
        Integer $timeout = this.getTimeout();
        result1 = result1 * 31 + ($timeout == null?0:$timeout.hashCode());
        Integer $threads = this.getThreads();
        result1 = result1 * 31 + ($threads == null?0:$threads.hashCode());
        Integer $heartBeats = this.getHeartBeats();
        result1 = result1 * 31 + ($heartBeats == null?0:$heartBeats.hashCode());
        String $host = this.getHost();
        result1 = result1 * 31 + ($host == null?0:$host.hashCode());
        String $serialization = this.getSerialization();
        result1 = result1 * 31 + ($serialization == null?0:$serialization.hashCode());
        String $version = this.getVersion();
        result1 = result1 * 31 + ($version == null?0:$version.hashCode());
        String $mode = this.getMode();
        result1 = result1 * 31 + ($mode == null?0:$mode.hashCode());
        return result1;
    }

    public String toString() {
        return "DubboProperties(name=" + this.getName() + ", registry=" + this.getRegistry() + ", port=" + this.getPort() + ", timeout=" + this.getTimeout() + ", threads=" + this.getThreads() + ", heartBeats=" + this.getHeartBeats() + ", host=" + this.getHost() + ", serialization=" + this.getSerialization() + ", version=" + this.getVersion() + ", mode=" + this.getMode() + ")";
    }
}